package com.yanqu.road.server.cmd.activity.seacraftsouthsea;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.SeacraftSouthSeaProto;
import com.yanqu.road.server.cmd.CrossUnionCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.activity.seacraftsouthsea.SeacraftSouthSeaMgr;
import com.yanqu.road.server.protocol.CrossProtocol;

import java.util.List;

/**
 * @Description
 * @Author cwq
 * @Data 2022/1/20 17:21
 */
@Cmd(code = CrossProtocol.C2_SEACRAFT_SOUTH_SEA_SYN_PATRONS_INFO, desc = "海上争霸 南海丝路 同步有变化的门客信息")
public class CrossSeacraftSouthSeaSynPatronsInfoCmd extends CrossUnionCommand {

    long userId;
    int activityId;
    List<SeacraftSouthSeaProto.SeacraftSouthSeaSynUserPatronsInfo> userPatronsInfoList;
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        SeacraftSouthSeaProto.SeacraftSouthSeaSynUserInfoGameToCrossMsg reqMsg = SeacraftSouthSeaProto.SeacraftSouthSeaSynUserInfoGameToCrossMsg.parseFrom(packet.getBytes());
        activityId = reqMsg.getActivityId();
        userPatronsInfoList = reqMsg.getUserPatronsListList();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        SeacraftSouthSeaMgr.synUserInfo(activityId, groupId, userPatronsInfoList);

    }

    @Override
    public void sendData() {

    }
}
